package com.qykj.ddhing.pda.demo.dagger2.test3;

/**
 * @author liuxiaofeng QQ:363204195
 * @name ddhing_pda
 * @class name：com.qykj.ddhing.pda.demo.dagger2.test3
 * @class describe
 * @time 2018/7/18 23:14
 * @change
 * @chang time
 * @class describe
 */

import com.qykj.ddhing.pda.demo.dagger2.test1.User;
import com.qykj.ddhing.pda.demo.dagger2.test2.User2;

import javax.inject.Named;

import dagger.Module;
import dagger.Provides;
@Module
public class MainModule {

    @Provides
    @Named("name")
    User2 provideUser2() {
        return new User2("provideUser2");
    }

/*@Qualifier限定符的作用 */
    @Provides
    @ForTest
    User2 provideUser21() {
        return new User2("provideUser21");
    }

    @Provides
    String provideUserName(@ForTest User user) {
        return user.getName();
    }
}
